import {defHttp} from '/@/utils/http/axios';
import {Modal} from 'ant-design-vue';

enum Api {
  pageCheckDiff = "/pay-service/checkDiff/page",
  getCheckDiff = "/pay-service/checkDiff/get",
  ignoreCheckDiff = "/pay-service/checkDiff/ignoreDiff",
  deleteCheckDiff = "/pay-service/checkDiff/delete",
  batchDeleteCheckDiff = "/pay-service/checkDiff/batchDelete",
}

export const getCheckDiff = (params) => {
  return defHttp.get({url : Api.getCheckDiff, params});
}

export const pageCheckDiff = (params) => {
  return defHttp.get({url : Api.pageCheckDiff, params});
}

export const ignoreCheckDiff = (params) => {
  return defHttp.put({url: Api.ignoreCheckDiff, params}, {joinParamsToUrl: true});
}

export const batchDeleteCheckDiff = (params, handleSuccess) => {
  Modal.confirm({
    title: '确认删除',
    content: '是否删除选中数据',
    okText: '确认',
    cancelText: '取消',
    onOk: () => {
      return defHttp.delete({url: Api.batchDeleteCheckDiff, data: params}, {joinParamsToUrl: true}).then(() => {
        handleSuccess();
      });
    }
  });
}
